function WorkPlatFrom() {

	this.initEvent()
}
WorkPlatFrom.prototype.initEvent = function() {
	viewWidthHeightSetup()
	mui(".mui-scroll").on("tap", ".openWindow", function() {
		var title = this.getElementsByClassName("textTip")[0].innerText
		var extras = {
			'title': title
		}
		$openWindow(this, "data-page", extras)
		var id = this.getAttribute('data-page');
		var detailPage = plus.webview.getWebviewById(id)
		if (detailPage) {
			detailPage.addEventListener('close',function(){
				plus.nativeUI.closeWaiting()
			})
		}
	})
	//APPMenu 菜单显示与否
	var APPMenu = app.getState().APPMenu
	if (!APPMenu) {
		return
	}
	mui('.noPermission').each(function(domIndex, dom) {
		var code = dom.getAttribute('data-menu')
		if (code && code != "" && APPMenu[code]) {
			dom.classList.remove('noPermission')
		}
	})
	window.addEventListener('listenner', function(e) {
		if (e.detail.dblTap) {
			mui('#trainWrapper').scroll().scrollTo(0, 0, 100);
		}
	});
	var perInfo = app.getState()
	if (parseInt(perInfo['maxRoleLevel']) > 4 ) { //护理部和护士长角色有审批中心
		mui('#locManager')[0].style.display = 'none'
		return
	}
	return
	var roles = perInfo['loginRoleCodes']||''
	var arr = roles.split(',')
	var has = false
	for (var i = 0; i < arr.length; i++) {
		if (arr[i] == '') {
			continue
		}
		if (arr[i]+'' == '2' || arr[i]+'' == '4') {
			has = true
			break
		}
	}
	if (!has) {
		mui('#locManager')[0].style.display = 'none'
	}
}
/*
 * 界面宽高设置
 */
function viewWidthHeightSetup() {
	var dom = mui('.manageBase')[0]
	var height = dom.clientWidth* 0.42;
	if (height == 0 || dom.style.height != '') {
		return
	}
	mui('.manageBase').each(function (index,dom) {
		dom.style.height = height + 'px';
	})
}
//window.onresize = viewWidthHeightSetup
new WorkPlatFrom()